<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Life Runner:  File sorgente pilamatrici.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Batteri.jpg"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Life Runner
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Il Gioco della Vita</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generato da Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Cerca');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Pagina&#160;Principale</span></a></li>
      <li><a href="annotated.html"><span>Classi</span></a></li>
      <li class="current"><a href="files.html"><span>File</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Cerca" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Elenco&#160;dei&#160;file</span></a></li>
      <li><a href="globals.html"><span>Elementi&#160;dei&#160;file</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tutto</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classi</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>File</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funzioni</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variabili</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Tipi enumerati (enum)</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Valori del tipo enumerato</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pagine</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">pilamatrici.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="pilamatrici_8h.html">Vai alla documentazione di questo file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef PILAMATRICI_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PILAMATRICI_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;QtGui&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;ctime&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="main_8h.html">main.h</a>&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="classPilaMatrici.html">   44</a></span>&#160;<span class="keyword">class </span><a class="code" href="classPilaMatrici.html" title="The PilaMatrici class La classe PilaMatrici si occupa della parte algoritmica e computazionale.">PilaMatrici</a></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;{</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="classPilaMatrici.html#a1bf3cd0a3a8adb847a0fd95533e836a6" title="PilaMatrici costruttore.">PilaMatrici</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#af028871def60fbc8c46fedd3b4c7571e">pattern</a>);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="classPilaMatrici.html#acb22e1cdc86354f1ec113374d0347f18" title="PilaMatrici decostruttore.">~PilaMatrici</a>();</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordtype">int</span> * <a class="code" href="classPilaMatrici.html#a293d5f6795e2e6963a1e0f358706f937" title="Per ottenere la tabella attuale.">getMatrix</a>();</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">int</span> * <a class="code" href="classPilaMatrici.html#a0ea12c7a63432eb38362b5adc9959d2d" title="Permette di avanzare alla matrice successiva.">next</a>();</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#a817827747ed97447a71b8d083acf4744" title="Stampa su stdout l&#39;intera tabella.">stampa</a> ();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#ad9b2af953563a35bc0533fafac0ad32f">  118</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#ad9b2af953563a35bc0533fafac0ad32f" title="Ritorna la dimensione orizzontale della matrice.">getDimx</a>() { <span class="keywordflow">return</span> <a class="code" href="classPilaMatrici.html#a68e942fec2e4351413744ec4984b4dbe">dimx</a>;}</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#adbc7b723d420ee0475c6962387114a0e">  124</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#adbc7b723d420ee0475c6962387114a0e" title="Ritorna la dimensione verticale della matrice.">getDimy</a>() { <span class="keywordflow">return</span> <a class="code" href="classPilaMatrici.html#a5628d441e7836fd04c73268f120d2d9e">dimy</a>;}</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classPilaMatrici.html#ae6acf13fe85f6e4c8b050932c7c109c0" title="Salvataggio su File della matrice.">salva</a> (QString file);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classPilaMatrici.html#ac37116f0525280353fccac6e1bbd7543" title="Caricamento da File della matrice.">carica</a> (QString file);</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a69c1ed611ea245f8e77b28d2e47d4079">  161</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#a69c1ed611ea245f8e77b28d2e47d4079" title="Numero di matrici realizzate (utilita&#39; statistica)">matriciRealizzate</a>;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classPilaMatrici.html#a24ae0fe74a46693ea24582a8608ce8df" title="Viaggio nel tempo.">timeTrip</a>(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a68e942fec2e4351413744ec4984b4dbe">  181</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#a68e942fec2e4351413744ec4984b4dbe">dimx</a>;   <span class="comment">//Dimensioni della matrice</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a5628d441e7836fd04c73268f120d2d9e">  182</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#a5628d441e7836fd04c73268f120d2d9e">dimy</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#af028871def60fbc8c46fedd3b4c7571e">  183</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#af028871def60fbc8c46fedd3b4c7571e">pattern</a>;</div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a577b11e786ed923662e6be11c8b37340a3e2ddc8c435505116d0123d27fdf3582">  184</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="classPilaMatrici.html#a577b11e786ed923662e6be11c8b37340">stato</a> {<a class="code" href="classPilaMatrici.html#a577b11e786ed923662e6be11c8b37340a64f830c1ec16dabf749b8026e8e0265e">morto</a> = 0, <a class="code" href="classPilaMatrici.html#a577b11e786ed923662e6be11c8b37340a3e2ddc8c435505116d0123d27fdf3582">vivo</a> = 1};</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html">  194</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a> {</div>
<div class="line"><a name="l00195"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html#a5f92ea433100ecf4dc8163fb93404c9b">  195</a></span>&#160;        <span class="keywordtype">int</span>* <a class="code" href="structPilaMatrici_1_1Matrix.html#a5f92ea433100ecf4dc8163fb93404c9b">tabella</a>;</div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html#ac71f38a0dc138d4b418316bd25e6b184">  196</a></span>&#160;        <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="structPilaMatrici_1_1Matrix.html#ac71f38a0dc138d4b418316bd25e6b184">succ</a>;</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html#a6e8d24ed2b3038b41a7cc92f2aa8d984">  197</a></span>&#160;        <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="structPilaMatrici_1_1Matrix.html#a6e8d24ed2b3038b41a7cc92f2aa8d984">prec</a>;</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html#a11f3959976e442888b365e37b1c70de9">  198</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structPilaMatrici_1_1Matrix.html#a11f3959976e442888b365e37b1c70de9">tempo</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="code" href="structPilaMatrici_1_1Matrix.html#afe0719260234ad91e07ed0a271536fee">  199</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structPilaMatrici_1_1Matrix.html#afe0719260234ad91e07ed0a271536fee">numeroCelleVive</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    };</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="comment">      * Due puntatori, uno alla testa e uno alla coda della lista di matrici</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;<span class="comment">      * Un puntatore alla matrice attuale</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#acb98428fafcbc5b0b6664c15c0b56112">  206</a></span>&#160;    <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="classPilaMatrici.html#acb98428fafcbc5b0b6664c15c0b56112">testa</a>;</div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a08b715899e30cd0995ee8750e06b0b0c">  207</a></span>&#160;    <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="classPilaMatrici.html#a08b715899e30cd0995ee8750e06b0b0c">coda</a>;</div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="code" href="classPilaMatrici.html#a70640328db16b15d5803639cf7da902e">  208</a></span>&#160;    <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="classPilaMatrici.html#a70640328db16b15d5803639cf7da902e">posizioneAttuale</a>;</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <span class="comment">/* Funzione creaMatrice().</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="comment">      1)    Alloca dinamicamente una matrice temporanea delle dimensioni</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;<span class="comment">      passate dall&#39;utente.</span></div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;<span class="comment">      2)    Aggancia la matrice allocata dinamicamente alle due matrici passate</span></div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;<span class="comment">      come parametro.</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment">      3)    Inizializza il campo tabella della matrice creata, le dimensioni</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment">      sono maggiorate di 2 perche&#39; creo anche una cornice aggiuntiva di zeri</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="comment">      utile all&#39;algoritmo nella sua esecuzione.</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;<span class="comment">      4)    Inizializza tutta la matrice a 0 e la ritorna come parametro di</span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="comment">      uscita.</span></div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;<span class="comment">      @param [in]   succ    Puntatore alla matrice successiva</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">      @param [in]   prec    Puntatore alla matrice precedente</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="comment">      @param [in]   tempo   Indica il numero della matrice</span></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;<span class="comment">      @param [out]  temp    Matrice appena creata ed inizializzata</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* <a class="code" href="classPilaMatrici.html#a1c99597cb1b8fc81bd8df0a74c04cea2">creaMatrice</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* succ, <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* prec, <span class="keywordtype">int</span> tempo);</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <span class="comment">/* Funzione riempiCasuale.</span></div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;<span class="comment">      1)    Utilizzando le funzioni di cstdlib setta il seme da cui calcolare</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;<span class="comment">      i numeri random tramite la funzione rand() e inizializza un intero tot</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">      da utilizzare per debug.</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment">      2)    Genera casualmente un numero, che risultera&#39;  sempre 0 &lt; x &lt; 1.</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment">      Posso controllare la frequenza di celle settate a 1 modificando l&#39;ultimo</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment">      valore che sommo al risultato perche&#39; piu&#39; e&#39; vicino ad 1, piu&#39; le celle</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">      settate saranno frequenti, altrimenti le celle settate saranno in minor</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">      numero.</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="comment">      @param [in]   Matrix*     Puntatore alla matrice attuale</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#ad27fd7ae4c80db6f058e4f1c1d53bbc3">riempiCasuale</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>*);</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">/* Funzione inizializzaTabella.</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="comment">      Assegna ad ogni elemento della tabella il valore passato come</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;<span class="comment">      parametro</span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;<span class="comment">      @param [in]   Matrix*     Matrice della posizione attuale</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;<span class="comment">      @param [in]   int         Valore da applicare a tutti gli elementi</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#a213a3a18abf6e92b728228329cd84e82">inizializzaTabella</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>*, <span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="comment">/* Funzione inizializzaCasella.</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="comment">      Assegna all&#39;elemento della tabella indicato dal secondo parametro,</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="comment">      il valore passato come terzo parametro</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="comment">      @param [in]   pos     Matrice della posizione attuale</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="comment">      @param [in]   casella Casella di cui modificare il valore</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="comment">      @param [in]   valore  Valore da applicare a tutti gli elementi</span></div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classPilaMatrici.html#ad0932211906943c62a4880d76baacb9c">inizializzaCasella</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>* pos, <span class="keywordtype">int</span> casella, <span class="keywordtype">int</span> valore);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="comment">/* Funzione getValore.</span></div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;<span class="comment">      1)    Ritorna il valore della casella passata dai tre parametri</span></div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="comment">      Utilizzo la forma t[x + y * (dimx + 2)] perche&#39; ho inizializzato la</span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="comment">      matrice come un array e non come un array di array, di conseguenza la x</span></div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="comment">      indicherebbe la colonna, cui va sommato il numero della riga moltiplicato</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;<span class="comment">      per in numero di colonne aumentato di due (questo perche&#39; devo comunque</span></div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;<span class="comment">      considerare la cornice esterna.</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;<span class="comment">      @param [in]   cella   Puntatore alla cella corrente</span></div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<span class="comment">      @param [in]   x       Colonna della cella</span></div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;<span class="comment">      @param [in]   y       Riga della cella</span></div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#a437f4876f3c26a991d84cd9c5d5302c6">getValore</a>(<span class="keywordtype">int</span> * cella, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="comment">/* Funzione contaCelleVive.</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;<span class="comment">      Per ogni matrice, setta a 0 il numero di cellule vive, e la scorre</span></div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;<span class="comment">      completamente incrementando di 1 il numero di cellule vive ogni volta che</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="comment">      ne incontra una viva.</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="comment">      @param    [in]    Matrix*&amp;    Matrice della quale contare le cellule vive</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classPilaMatrici.html#a0b77a2c93ee5f238b41afcc91e7ade7d">contaCelluleVive</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a> * &amp;);</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <span class="comment">/* Funzione verificamatriciUguali.</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;<span class="comment">      Questa funzione confronta due matrici e ritorna vero se sono uguali.</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;<span class="comment">      Ritorna falso se la prima tabella di confronto  anche la prima della pila</span></div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;<span class="comment">      oppure se la prima tabela di confronto  precedente alla seconda.</span></div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;<span class="comment">      @param [in]   Matrix*     Prima tabella di confronto</span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;<span class="comment">      @param [in]   Matrix*     Seconda tabella di confronto</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classPilaMatrici.html#a03cfd164141c4f0df8e826ed44d2155a">verificaMatriciUguali</a>(<a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>*, <a class="code" href="structPilaMatrici_1_1Matrix.html" title="The Matrix struct.">Matrix</a>*);</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#ae04b8c2af5ccc24233d8936d333a9830">patternModeSelector</a>(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#a1af0000c2498b94443a0cbf523f0217a">pattern1</a>();</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#ab36fca974f9ec75ae3a385bbc4d14c0e">pattern2</a>();</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#a833d75c828cf42c6a7aaaafcf9ccdcd6">pattern3</a>();</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classPilaMatrici.html#abe47ae91e03eb993a0f7273c6a5f0e76">pattern4</a>();</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;};</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="preprocessor">#endif // PILAMATRICI_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generato Ven 16 Nov 2012 15:59:35 per Life Runner da &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>
